1. Field of the Invention
The present invention relates to an image processing apparatus that is capable of correcting color shift of an image obtained through photographing, a method of controlling the image processing apparatus, and a storage medium.
2. Description of the Related Art
In general, an image pickup apparatus, such as a digital camera, is equipped with an image processing apparatus for correcting color shift caused by a chromatic difference of magnification which is generated in an image obtained through photographing (also referred to as a photographed image”). To correct color shift, there has been proposed an image processing apparatus which is configured to correct a photographed image by shifting the phase of an R (red) or a B (blue) signal with respect to a G signal by a color shift amount determined according to a predetermined design value (see Japanese Patent Laid-Open Publication No. 2008-15946).
Further, there has also been proposed an image processing apparatus which is configured to detect a color shift amount used for correction of color shift from feature points (mainly, edge portions) of a photographed image. For example, there has been proposed an image processing apparatus which is configured to evaluate reliability of results of detection of color shift amounts in the feature points according to the number of detected feature points, detection variation thereof, and detected image heights, and when the reliability is low, occurrence of an error is prevented by using a color shift amount calculated based on an approximate curve low in the degree of freedom determined by performing curve fitting on the results of detection of color shift amounts (see International Publication No. WO-2007-105359 (Japanese Patent Application No. 2008-504985)).
Further, there has been proposed an image processing apparatus which is configured to correct a plurality of photographed images according to an average value of color shift amounts calculated from the plurality of photographed images which are estimated to have the same chromatic difference of magnification, to thereby improve correction accuracy compared with a case where color shift amounts are calculated from a single photographed image (see Japanese Patent Laid-Open Publication No. 2004-120480).
However, in the method proposed in Japanese Patent Laid-Open Publication No. 2008-15946, when there is a lens manufacturing error or a difference between individual lenses, there occurs a difference between the color shift amount based on the predetermined design value and an actual color shift amount.
Further, in the methods proposed in International Publication No. WO-2007-105359 (Japanese Patent Application No. 2008-504985), and Japanese Patent Laid-Open Publication No. 2004-120480, since color shift amounts are calculated from a photographed image, correction accuracy is not degraded by the lens manufacturing error or the difference between individual lenses. However, if the photographed image is not in a state allowing proper detection of the color shift amounts, the detection and correction accuracy thereof are changed. In the method proposed in International Publication No. WO-2007-105359 (Japanese Patent Application No. 2008-504985), whenever an image is photographed, color shift correction is performed using only color shift amounts detected from the one photographed image, so that if the reliability of the detected color shift amounts is low, the accuracy of the color shift correction is inevitably degraded.
Further, in the method proposed in Japanese Patent Laid-Open Publication No. 2004-120480, a plurality of images photographed under the same photographing conditions are collectively processed for detecting and correcting color shift amounts thereof, and hence unless a plurality of photographed images remain or stored in the image pickup apparatus, it is impossible to perform the color shift correction processing.